import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// import Home from '../views/Home.vue'
// import About from '../views/About.vue'

const routes: Array<RouteRecordRaw> = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   component: About
  // }
  // 登录
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue')
  },
  // 注册
  {
    path: '/registry',
    name: 'Registry',
    component: () => import('@/views/registry/index.vue')
  },
  {
    path: '/',
    name: 'Layouts',
    component: () => import('@/layouts/BasicLayout.vue'),
    redirect: '/springRain',
    children: [
      {
        path: '/springRain',
        name: '春雨',
        component: () => import('@/views/springRain/index.vue')
      },
      {
        path: '/shoppingMall',
        name: '商城',
        component: () => import('@/views/shoppingMall/index.vue')
      },
      {
        path: '/popularization',
        name: '科普',
        component: () => import('@/views/popularization/index.vue')
      },
      {
        path: '/mine',
        name: '我的',
        component: () => import('@/views/mine/index.vue')
      },
      {
        path: '/healthrecords',
        name: 'healthrecords',
        component: () => import('@/views/healthrecords/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
